package com.millstein.tsinglog.mapper.biz;

import com.millstein.tsinglog.mapper.BaseMapper;
import com.millstein.tsinglog.model.pojo.Permission;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface PermissionMapper extends BaseMapper<Permission> {
    /**
     * 根据id查询权限
     * @param id
     * @return
     */
    @Select("SELECT `id`, `permission_name` permissionName, `permission_type` permissionType, " +
            "`permission_code` permissionCode, `parent_id` parentId, `sort`, `url`, `icon`, `status`, " +
            "`create_time` createTime, `update_time` updateTime FROM `sys_permission` " +
            "where `status` = 1 and `id` = #{id};")
    Permission selectPermissionByPrimaryKey(@Param("id") Long id);
}
